package edu.uw.tcss360.group6.gui;


import edu.uw.tcss360.group6.model.User;

import javax.swing.*;

import java.awt.*;

public final class GUI
{
    private static final String TITLE = "BeWeavers";
    public final JFrame my_frame;
    public final MainPanel my_main_panel;
    public final SidebarPanel my_side_panel;
    public final TopPanel my_top_panel;
    public User currentUser = null;
    public boolean flag = false; 
    public boolean draft1_flag = false;
    public boolean draft2_flag = false;
    public boolean draft3_flag = false;

	private GUI(){
        my_frame = new JFrame(TITLE);
        my_main_panel = new MainPanel();
        my_side_panel = new SidebarPanel();
        my_top_panel = new TopPanel();
       ;
        my_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        my_frame.getContentPane().add(my_main_panel, BorderLayout.CENTER);
        my_frame.getContentPane().add(my_side_panel, BorderLayout.EAST);
        my_frame.getContentPane().add(my_top_panel, BorderLayout.NORTH);
        my_frame.pack();
    }


    private static GUI the_instance;
    public static GUI instance() {
        if(the_instance == null)
            the_instance = new GUI();

        return the_instance;
    }

    private void start() {

        my_frame.setVisible(true);
    }
    public void setFlag(boolean value)
    {
    	flag = value;
    }
    public boolean getFlag()
    {
    	return flag;
    }
    public void setdraftFlag1(boolean value)
    {
    	draft1_flag = value;
    }
    public boolean getdraftFlag1()
    {
    	return draft1_flag;
    }
    public void setdraftFlag2(boolean value)
    {
    	draft2_flag = value;
    }
    public boolean getdraftFlag2()
    {
    	return draft2_flag;
    }
    public void setdraftFlag3(boolean value)
    {
    	draft3_flag = value;
    }
    public boolean getdraftFlag3()
    {
    	return draft3_flag;
    }


	public static void main(final String... the_args)
	{
		GUI.instance().start();
		
	}
}
